 //此文件跟更换用户头像有关的
 // 获取触发模态框的自定义属性
        var modalButtonsu = document.querySelectorAll("[data-modal-action]");
        // 获取模态框主体
        var modalsu = document.querySelectorAll(".modalu");

        // 监听模态框的按钮事件
        modalButtonsu.forEach(function(button) {
            button.addEventListener("click", function() {
                var targetId = this.dataset.modalTarget;
                var targetModal = document.getElementById(targetId);

                if (targetModal) {
                    var action = this.dataset.modalAction;

                    if (action === "openu") {
						// console.log("有执行open2")
                        openModalu(targetModal);
                    } else if (action === "closeu") {
						// console.log("有执行close")
					
                        closeModalu(targetModal);
                    }
                }
            });
        });

        // 打开模态框
        function openModalu(modal) {
            modal.style.display = "block";
            modal.querySelector(".modal-contentu").classList.remove("modal-hideu");
        }

        // 关闭模态框
        function closeModalu(modal) {
            modal.querySelector(".modal-contentu").classList.add("modal-hideu");
            modal.querySelector(".modal-contentu").addEventListener("animationend", function () {
                modal.style.display = "none";
            }, { once: true });
        }

        // 监听模态框的关闭时事件
        modalsu.forEach(function(modal) {
            var closeButton = modal.querySelector(".closeu");
            if (closeButton) {
                closeButton.addEventListener("click", function() {
                    var targetModal = this.closest(".modalu");
                    closeModalu(targetModal);
                });
            }
        });

        // 当用户点击模态框外部时，关闭模态框
   //      window.onclick = function (event) {
			// // console.log("点击了")
   //          modalsu.forEach(function(modal) {
   //              if (event.target === modal) {
   //                  closeModalu(modal);
   //              }
   //          });
   //      };
		 // 当用户点击模态框外部时，关闭模态框
		 window.addEventListener('click',function(event){
			 modalsu.forEach(function(modal) {
			     if (event.target === modal) {
			         closeModalu(modal);
			     }
			 });
		 })